/*
 * Copyright (c) 2009 XMock contributors
 * This program is made available under the terms of the Apache License.
 */
package org.xmock.controller;

import java.util.HashMap;

public class MockCase
{
	private String name;
	private String id;
	private boolean rerecord;
	private boolean disabled = false;

	private HashMap<String,String> params;
	
	public MockCase()
	{
		
	}
	
	public MockCase(String name, String id)
	{
		this.name = name;
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	public boolean equals(MockCase mockCase)
	{
		return (this.name.equals(mockCase.name) && this.id.equals(mockCase.id));		
	}
	
	public void setParam(String param, String value)
	{
		getParameters().put(param, value);
	}
	
	public String getParam(String param)
	{
		if(params == null)
		{
			return null;
		}
		return (String)getParameters().get(param);
	}
	
	private HashMap<String,String> getParameters()
	{
		if(params == null)
		{
			params = new HashMap<String,String>();
		}
		return params;
	}

	/**
	 * @return the rerecord
	 */
	public boolean isRerecord() {
		return rerecord;
	}

	/**
	 * @param rerecord the rerecord to set
	 */
	public void setRerecord(boolean rerecord) {
		this.rerecord = rerecord;
	}
	/**
	 * @return the disabled
	 */
	public boolean isDisabled() {
		return disabled;
	}

	/**
	 * @param disable the disabled to set
	 */
	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

}
